package v1

import (
	"DuckShop/pkg/middlewares"
	"github.com/gin-gonic/gin"
)

var prefix = "/api/v1/user"

// InitUserRoutes 初始化API routes！
func InitUserRoutes(r *gin.Engine, api UserAPI) {
	uc := &UserControllerImpl{userAPI: api}
	v1 := r.Group(prefix)
	v1Auth := r.Group(prefix)
	v1Auth.Use(middlewares.JWTAuthMiddleware())
	v1.POST("/create", uc.CreateUserController)
	v1.POST("/enter", uc.UserEnterController)
	v1Auth.POST("/list", uc.ListUserController)
	v1Auth.GET("/profile", uc.UserProfileController)
}
